Repository navigation
Reduce MTP command-line validation allocations - #10543
Conversation
Defer per-option provider HashSet allocation until a duplicate registration is actually encountered. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the deferred HashSet path identical to the previous implementation when one provider repeats an option name. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Reduces allocations during MTP command-line option validation while preserving duplicate-provider diagnostics.
Changes:
- Lazily allocates provider sets only for duplicated options.
- Extends coverage to verify three colliding providers retain registration order.
Show a summary per file
| File | Description |
|---|---|
CommandLineOptionsValidator.RegistrationValidation.cs |
Optimizes duplicate-provider tracking. |
CommandLineHandlerTests.cs |
Verifies all colliding providers are reported. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
🧵 Parallel-safety audit — PR #10543Nothing audited here touches process-global state, shared filesystem paths, or The PR only refactors Audited Re-run with
|
🧪 Expert test review — PR #10543
This advisory comment was generated automatically. Grades are heuristic and informational — they do not block merging. Re-run with
|
Summary
HashSetallocation until an option name is actually repeatedPerformance
A controlled in-process benchmark ran command-line validation 1,000 times with 100 unique options:
Repeated zero-match process startup remained neutral within Windows launch noise: mean 928.23 ms to 927.27 ms and median 888.02 ms to 875.36 ms over 30 warm runs.
Validation
Microsoft.Testing.Platform.UnitTests.csprojfor all target frameworks (netstandard2.0,net8.0,net9.0,net462)Microsoft.Testing.Platform.UnitTestsonnet8.0